package com.nts.visionworks.business.schedule.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.nts.visionworks.core.validation.EntityIdNotNull;

/**
 * ScheduleContentsStage generated by hbm2java
 */
@Entity
@Table(name = "schedule_contents_stage", catalog = "visionworks")
public class ScheduleContentsStage implements java.io.Serializable
{

	private Integer stageId;
	private Schedule schedule;
	private String stageName;
	private int playOrder;
	private String description;
	private Set<ScheduleStageDivision> scheduleStageDivisions = new HashSet<ScheduleStageDivision>(
			0);

	public ScheduleContentsStage()
	{
	}

	public ScheduleContentsStage(Schedule schedule, String stageName,
			int playOrder)
	{
		this.schedule = schedule;
		this.stageName = stageName;
		this.playOrder = playOrder;
	}

	public ScheduleContentsStage(Schedule schedule, String stageName,
			int playOrder, String description,
			Set<ScheduleStageDivision> scheduleStageDivisions)
	{
		this.schedule = schedule;
		this.stageName = stageName;
		this.playOrder = playOrder;
		this.description = description;
		this.scheduleStageDivisions = scheduleStageDivisions;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "StageId", unique = true, nullable = false)
	public Integer getStageId()
	{
		return this.stageId;
	}

	public void setStageId(Integer stageId)
	{
		this.stageId = stageId;
	}

	@EntityIdNotNull(message = "validation.scheduleContentsStage.schedule.notNull")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ScheduleId", nullable = false)
	public Schedule getSchedule()
	{
		return this.schedule;
	}

	public void setSchedule(Schedule schedule)
	{
		this.schedule = schedule;
	}

	@NotNull(message = "validation.scheduleContentsStage.stageName.notNull")
	@Size(message = "validation.scheduleContentsStage.stageName.length", max = 100, min = 1)
	@Column(name = "StageName", nullable = false, length = 100)
	public String getStageName()
	{
		return this.stageName;
	}

	public void setStageName(String stageName)
	{
		this.stageName = stageName;
	}

	@Min(message = "validation.scheduleContentsStage.playOrder.min", value = 1)
	@Column(name = "PlayOrder", nullable = false)
	public int getPlayOrder()
	{
		return this.playOrder;
	}

	public void setPlayOrder(int playOrder)
	{
		this.playOrder = playOrder;
	}

	@Max(message = "validation.scheduleContentsStage.description.max", value = 1000)
	@Column(name = "Description", length = 1000)
	public String getDescription()
	{
		return this.description;
	}

	public void setDescription(String description)
	{
		this.description = description;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "scheduleContentsStage")
	public Set<ScheduleStageDivision> getScheduleStageDivisions()
	{
		return this.scheduleStageDivisions;
	}

	public void setScheduleStageDivisions(
			Set<ScheduleStageDivision> scheduleStageDivisions)
	{
		this.scheduleStageDivisions = scheduleStageDivisions;
	}

}
